import { http } from "@/utils/http";

type ResultTable = {
  total?: number;
  data?: Array<any>;
};

//查询设施活动
export const facilityquery = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/api/v1/facility/query`, {
    data
  });
};
//新增设施活动
export const facilitysave = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/api/v1/facility/save`, {
    data
  });
};
//编辑设施活动
export const facilityedit = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/api/v1/facility/edit`, {
    data
  });
};
//删除设施活动
export const facilitydelete = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/api/v1/facility/delete`, {
    data
  });
};
//设施活动详情
export const facilitydetail = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/api/v1/facility/detail`, {
    data
  });
};

// 单位自动转换
export const facilityUnitConvert = (params: object | undefined) =>
  http.request(
    "get",
    `/energy/api/v1/facility/unitConvert`,
    { params },
    {
      headers: { noLoading: false }
    }
  );
